package com.lychee.system.controller.monitor;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.lychee.common.core.domain.JsonResult;
import com.lychee.common.core.domain.model.Server;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 服务器监控
 *
 * @author DingHao
 */
@RestController
@RequestMapping(value = "/monitor", produces = MediaType.APPLICATION_JSON_VALUE)
public class ServerController {

    @SaCheckPermission("system:server:list")
    @GetMapping(value = "/server")
    public JsonResult<Server> getInfo() throws Exception {
        Server server = new Server();
        server.copyTo();
        return JsonResult.ok(server);
    }
}
